package com.siyuan.neo4j.controller;

import com.siyuan.neo4j.model.UserNode;
import com.siyuan.neo4j.service.UserNodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @className: Neo4jController
 * @Description: TODO
 * @author: siyuan
 * @date: 2022/8/29 17:07
 */
@RestController
@RequestMapping
public class Neo4jController {

    @Autowired
    private UserNodeService userNodeService;

    @GetMapping("test")
    public Map<String,Object> test(){
        return new HashMap<>();
    }

    @ResponseBody
    @PostMapping("/saveUser")
    public String saveUser(@RequestBody UserNode userNode){
        userNodeService.saveNode(userNode);
        return "success";
    }

}
